let mysql = require("mysql")
let Con = mysql.createConnection({
    host: "localhost",
    port: "3306",
    user: "root",
    password: "root",
    database: "ucourse"
})
function Query(sqlStr) {
    return new Promise((resolve, reject) => {
        Con.query(sqlStr, (err, res) => {
            if (!err) {
                resolve([null,res])  
            } else {
                resolve([err])
            }
        })
    })
  
}
module.exports=Query
    